using System;
using System.IO;

namespace UraniaLib
{
	/// <summary>
	/// Summary description for UraniaCityList.
	/// </summary>
	/// 


	public class UraniaCityList
	{
		public string[] sCity = new string[2562];
		public string[] sState = new string[2562];
		public string[] sCountry = new string[2562];
		public double[] fLat = new double[2562];
		public double[] fLong = new double[2562];
		public double[] fTimeZone = new double[2562];
		public long lCities;

		public UraniaCityList()
		{
			long i;

			string sOrigRow = "";
			string[] aRow;
			UraniaDMS oDMS = new UraniaDMS();

			FileStream oFile = new FileStream("data\\cities.dat", FileMode.OpenOrCreate, FileAccess.Read);
			StreamReader oRead = new StreamReader(oFile);
			lCities = 2562;
	
			if (oFile.Length > 1)
			{
				i=0;
				for (i = 0; i < lCities; i++)
				{
					sOrigRow = oRead.ReadLine();
			
					aRow = sOrigRow.Split(',');
					sCity[i] = aRow[0].Trim();
					sState[i] = aRow[1].Trim();
					sCountry[i] = aRow[2].Trim();
					fLat[i] = Convert.ToDouble(aRow[3].Trim());
					fLong[i] = Convert.ToDouble(aRow[4].Trim());
					fTimeZone[i] = Convert.ToDouble(aRow[5].Trim());
				}
			}
			oRead.Close();
			oFile.Close();
		}
	}
}
